package com.codingfuture.erp_system.web.controller;

import com.codingfuture.erp_system.service.OrderDetailService;
import com.codingfuture.erp_system.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@Slf4j
@RestController
@RequestMapping("/v2")
public class OrderDetailController {

    @Autowired
    private OrderDetailService orderDetailService;


    @PostMapping("/orderdetail/doInStore")
    public Result doInStore(Integer id, Integer storeuuid) {
        Date date = new Date();
        Boolean result = orderDetailService.doInStore(id, storeuuid,date);
        return result ? Result.ok() : Result.error(201, "错误");
    }
}
